package com.rowline.admin.module.study.jdknewfeature;

/**
 * ClassName:ConvertorDemo
 * Created by 245167
 * on 2018/5/4  04:25
 * description:
 */
public class ConvertorDemo {

    static int outerStatixNum;

    int outerNum;


    public static void main(String[] args) {

        int num = 10;
//        Convertor<String,Integer> convertor = (from) -> Integer.valueOf(from);
//        Convertor<String,Integer> convertor = Integer::valueOf;
//        Integer converted = convertor.convert("123");
//        System.out.println(converted);
//
//        Convertor<Integer,String> convertor2 = (from) -> String.valueOf(from+num);
//        String converted2 = convertor2.convert(2000);
//        System.out.println(converted2);

        Convertor<Integer,String> convertor3 = (from) -> {
            outerStatixNum = 100;
            return String.valueOf(from+num+outerStatixNum);
        };
        String converted3 = convertor3.convert(2000);
        System.out.println(converted3);

        Convertor<Integer,String> convertor4 = (from) -> {
//            outerNum = 15;
//            return String.valueOf(from+num+outerNum);
            return String.valueOf(from+num);
        };
        String converted4 = convertor4.convert(2000);
        System.out.println(converted4);


    }
}
